package com.ebid.test;

import java.util.*;

public class LoopMap {

    public static void main(String[] args) {

        Map<String,Object> data = new HashMap<String,Object>();
        data.put("TENDER_PROJECT_CODE","M1100000015013194001");

        List<String> BID_SECTION_CODES = new ArrayList();
        BID_SECTION_CODES.add("M1100000015013194001001");
        BID_SECTION_CODES.add("M1100000015013194001002");
        BID_SECTION_CODES.add("M1100000015013194001003");
        data.put("BID_SECTION_CODES",BID_SECTION_CODES);

//        List<Map> TENDERERS = new ArrayList<>();
        Map<String,String> TENDERER = new HashMap();
        TENDERER.put("TENDER_CODE_TYPE","98");
        TENDERER.put("TENDERER_CODE","222222");
        TENDERER.put("TENDERER_NAME","蒙牛乳业（清远）有限公司");
        TENDERER.put("TENDERER_ADDRESS","广东省清远市高新技术开发区建设三路蒙牛乳业");
        TENDERER.put("TENDERER_CONTACTOR","郭小姐");
        TENDERER.put("TENDERER_PHONE_NUMBER","18500135737");
        TENDERER.put("TENDERER_EMAIL","839415501@qq.com");
//        TENDERERS.add(TENDERER);
        data.put("TENDERERS",TENDERER);

        Iterator iterator = data.entrySet().iterator();
        while (iterator.hasNext()){
            Map.Entry entry = (Map.Entry) iterator.next();

            if (entry.getValue() instanceof String){
                System.out.println("String");
                System.out.println(entry.getKey());
            }
            if (entry.getValue() instanceof List){
                System.out.println("list");
                List<String> list = (List) entry.getValue();
                for (String s : list){
                    System.out.println(s);
                }
            }
            if (entry.getValue() instanceof Map){
                System.out.println("map");

                Iterator ite = ((Map) entry.getValue()).entrySet().iterator();
                while (ite.hasNext()){
                    Map.Entry entry1 = (Map.Entry) ite.next();
                    System.out.println("key:"+entry1.getKey()+" value:" +entry1.getValue());
                }
            }

        }

    }
}
